package net.maku.im.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fhs.core.trans.anno.Trans;
import com.fhs.core.trans.constant.TransType;
import com.fhs.core.trans.vo.TransPojo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import net.maku.framework.common.utils.DateUtils;
import net.maku.im.constant.ImConstant;
import net.maku.im.entity.ImGroupEntity;
import net.maku.im.entity.ImUserEntity;

import java.io.Serializable;
import java.util.Date;

/**
* 群聊消息
*
* @author Blue 
* @since 1.0.0 2024-07-20
*/
@Data
@Schema(description = "群聊消息")
public class ImGroupMessageVO implements Serializable, TransPojo {
	private static final long serialVersionUID = 1L;

	@Schema(description = "id")
	private Long id;

	@Trans(type = TransType.SIMPLE,dataSource = ImConstant.DS_IM_PLATFORM,target = ImGroupEntity.class, fields = "name", ref = "groupName")
	@Schema(description = "群id")
	private Long groupId;

	@Schema(description = "群名称")
	private String groupName;

	@Trans(type = TransType.SIMPLE,dataSource = ImConstant.DS_IM_PLATFORM,target = ImUserEntity.class, fields = "userName", ref = "sendUserName")
	@Schema(description = "发送用户id")
	private Long sendId;

	@Schema(description = "发送用户id")
	private String sendUserName;

	@Schema(description = "发送用户昵称")
	private String sendNickName;

	@Schema(description = "发送内容")
	private String content;

	@Schema(description = "被@的用户id列表，逗号分隔")
	private String atUserIds;

	@Schema(description = "消息类型 0:文字 1:图片 2:文件 3:语音 10:系统提示")
	private Integer type;

	@Schema(description = "状态 0:正常  2:撤回")
	private Integer status;

	@Schema(description = "发送时间")
	@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
	private Date sendTime;

	@Schema(description = "是否回执消息")
	private Boolean receipt;

	@Schema(description = "回执消息是否完成")
	private Boolean receiptOk;

	@Schema(description = "接收用户id,逗号分隔，为空表示发给所有成员")
	private String recvIds;


}